{extend name="public/layout"/}
{block name="title"}资讯列表{/block}
{block name="head"}{/block}
{block name="body"}
<section class="mc-view-box">
  {include file="public/index_header" /}
  <div class="mc-scrollview">
    <div class="swiper-container" id="focus2">
      <div class="swiper-wrapper">
        {volist name=":patch('手机端新闻列表轮播图')" id="vo"}
        <div class="swiper-slide"><img src="{$vo.file_url}" class="mc-img-responsive" alt=""></div>
        {/volist}
      </div>
    </div>
    <div class="height-10"></div>
    <div class="mescroll" id="mescroll">
      <div class="news-page-list" id="mescroll-content"></div>
    </div>
  </div>
  {include file="public/index_footer" /}
</section>
{/block}
{block name="script"}
<script type="text/html" id="list-tpl">
  {@each data as value}
  <a href="/home/cms/info.html?id=${value.id}&class_id=${value.class_id}" class="news-item p-d mc-flex-box mc-flex-m mc-flex-s">
    <div class="news-info mc-flex-grow-1 m-r-10">
      <h2 class="font-black font-size18 line-height24 one-cut">${value.title}</h2>
      <div class="height-5"></div>
      <div class="font-gray font-size14 line-height24 two-cut text-justify">${value.description}</div>
    </div>
    {@if value.thumb!=''}
    <div class="mc-thumb-square thumb-90" style="background-image:url(${value.thumb})"></div>
    {@/if}
  </a>
  {@/each}
</script>
<script>
  $(function () {
    swiper.init();
    doAction.getlist();
  });
  var doAction = {
    getlist:function () {
      helper.mescroll('mescroll',{
        callback: function (page,mescroll) {
          helper.getAjax({
            url: '/home/cms/getPagelist.html?pageNumber=' + page.num + '&pageSize=' + page.size,
            data:helper.getSearchParams(),
            success: function (curPageData) {
              mescroll.endBySize(curPageData.rows.length, curPageData.total);
              var html = juicer($('#list-tpl').html(),{data:curPageData.rows});
              $('#mescroll-content').append(html);
            }, error:function (e) {
              mescroll.endErr();
            }
          });
        }
      });
    },
  }
</script>
{/block}